<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>任务管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
        $(document).ready(function() {

        });
        function page(n,s){
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
        function showDetail(startDate,stationDutyPerson,netDispatcher,weatherCondition,dutyPersonInfo,dutyPersonRemarks) {

            var startDate = startDate;
            var stationDutyPerson = stationDutyPerson;
            var netDispatcher = netDispatcher;
            var weatherCondition = weatherCondition;
            var dutyPersonInfo = dutyPersonInfo;
            var dutyPersonRemarks = dutyPersonRemarks;
			switch (weatherCondition)
			{
				case 'SUNNY':
                    weatherCondition = '晴天';
					break;
				case 'OVERCAST':
                    weatherCondition = '阴天';
					break;
				case 'RAIN':
                    weatherCondition = '雨天';
					break;

            }
            if( dutyPersonInfo == 'A') {
                dutyPersonInfo = '良好';
			} else {
                dutyPersonInfo = '不良';
			}
            var info = '签到信息<br/>&nbsp&nbsp&nbsp&nbsp签到时间：' + startDate + '<br/>&nbsp&nbsp&nbsp&nbsp签到人：' + stationDutyPerson +
				'<br/>&nbsp&nbsp&nbsp&nbsp网调室人员：' + netDispatcher + '<br/>&nbsp&nbsp&nbsp&nbsp天气：' + weatherCondition + '<br/>';
            info += '访问信息<br/>&nbsp&nbsp&nbsp&nbsp访问结果：' + dutyPersonInfo + '<br/>&nbsp&nbsp&nbsp&nbsp备注:' + dutyPersonRemarks + '<br/>';
            $.jBox.info(info);



        }
	</script>
</head>
<body>
<ul class="nav nav-tabs">
	<li class="active"><a href="${ctx}/devmng/listTaskMainExecDetail/">任务列表</a></li>

</ul>
<form:form id="searchForm" modelAttribute="taskMain" action="${ctx}/devmng/taskMain/taskMainExecDetailCompletedList" method="post" class="breadcrumb form-search">
	<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
	<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
	<ul class="ul-form">
		<li><label>任务名称：</label><form:input path="taskTitle" htmlEscape="false" maxlength="50" class="input-medium"/></li>
		<li><label>操作人：</label>
			<sys:treeselect id="taskOperator" name="taskOperator.id" value="${taskMain.taskOperator.id}" labelName="taskOperator.name" labelValue="${taskMain.taskOperator.name}"
							title="用户" url="/sys/office/treeData?type=3" cssClass="input-small" allowClear="true" notAllowSelectParent="true"/>
		</li>
		<li><label>任务类型：</label>
			<form:select path="taskType" class="input-medium">
				<form:option value="" label=""/>
				<form:options items="${fns:getDictList('DEVCHK_PERIOD')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</form:select>
		</li>
		<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
		<li class="clearfix"></li>
	</ul>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
	<thead>
	<tr>
		<th>任务标题</th>
		<th>任务执行人</th>
		<th>任务类型</th>
		<th>部门</th>
		<th>任务状态</th>
		<th>实际开始时间</th>
		<th>实际完成时间</th>

		<th>计划开始时间</th>
		<th>计划完成时间</th>
		<th>更新时间</th>
		<th>备注</th>

		<shiro:hasPermission name="devmng:taskMain:edit"><th>操作</th></shiro:hasPermission>
	</tr>
	</thead>
	<tbody>
	<c:forEach items="${page.list}" var="taskMain">
		<tr>
			<td>
					${taskMain.taskTitle}
			</td>
			<td>
					${taskMain.taskOperator.name}
			</td>
			<td>
					${ fns:getDictLabel (taskMain.taskType, 'DEVCHK_PERIOD', '')}
			</td>
			<td>
					${taskMain.sysOffice.name}
			</td>
			<td>
					${ fns:getDictLabel (taskMain.taskStatus, 'TASK_MAIN_STATUS', '')}
			</td>
			<td>
				<fmt:formatDate value="${taskMain.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
			</td>
			<td>
				<fmt:formatDate value="${taskMain.closeDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
			</td>
			<td>
				<fmt:formatDate value="${taskMain.taskStart}" pattern="yyyy-MM-dd HH:mm:ss"/>
			</td>
			<td>
				<fmt:formatDate value="${taskMain.taskEnd}" pattern="yyyy-MM-dd HH:mm:ss"/>
			</td>
			<td>
				<fmt:formatDate value="${taskMain.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
			</td>
			<td>
					${taskMain.remarks}
			</td>

			<shiro:hasPermission name="devmng:taskMain:edit"><td>
				<a href="javascript:void(0)" onclick='showDetail("<fmt:formatDate value="${taskMain.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
						, "${taskMain.stationDutyPerson}", "${taskMain.netDispatcher}", "${taskMain.weatherCondition}"
						, "${taskMain.dutyPersonInfo}", "${taskMain.dutyPersonRemarks}");'>
					签到查看
				</a>
				<a href="${ctx}/devmng/taskMain/taskMainExecDetailCompletedList?id=${taskMain.id}" target="_blank">任务详情</a>
			</td></shiro:hasPermission>
			<%--<shiro:hasPermission name="devmng:taskMain:edit"><td>
				<a href="${ctx}/devmng/taskMain/detail?id=${taskMain.id}">详情</a>
				<a href="${ctx}/devmng/taskMain/taskMainExecDetailListSingle?id=${taskMain.id}">情况</a>
			</td></shiro:hasPermission>--%>
		</tr>
	</c:forEach>
	</tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>